<%-- 
    Document   : lookup
    Created on : Aug 28, 2011, 7:20:03 PM
    Author     : krisada
--%>

<%@page import="limousine.vo.Users"%>
<%@page import="limousine.util.Token"%>
<%@page import="org.jsrpc.bridge.Key"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/jsrpc.tld" prefix="jsrpc"%>
<%@taglib uri="/WEB-INF/workforce.tld" prefix="work"%>
<!DOCTYPE html>

<% Users user = (Users) session.getAttribute(Token.USER_SESSION);
    if (user == null) {
        System.out.println("--SESSION EXPIRE--");
    }
%>

<jsrpc:broker>
    <jsrpc:register id="service" bean="workforce.limousine.service.DriverManager"/>
    <jsrpc:register id="serviceLookup" bean="workforce.limousine.service.LookupSearchManager"/>
    <script language="JavaScript" type="text/javascript" src="js/driver.js"></script>

    <script language="JavaScript" type="text/javascript" src="js/ui.js"></script>    
    <script language="JavaScript" type="text/javascript" src="js/JTable.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/table.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/validation.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/util.js"></script>


</jsrpc:broker>


<script language="JavaScript" type="text/javascript" src="jsrpc.js"></script>








<script language="JavaScript" type="text/javascript">
    



    <!--
    function initPage() {
    <%
        //String s = this.
        String s = request.getServletPath();
        System.out.println("login.jsp[" + s + "]");
        String sp[] = s.split("/");
        System.out.println("size:" + sp.length);
        StringBuffer sf = new StringBuffer();
        for (int i = 2; i < sp.length; i++) {
            //System.out.println("["+ sp[i]+"]");
            // sf.append("../");
        }
        String pageId = (String) pageContext.getAttribute(Key.PAGE_ID);
        session.setAttribute("BACK_PATH." + pageId, sf.toString());
        session.setAttribute("BACK_PATH." + pageId, sf.toString());
        sf.append(request.getScheme());
        sf.append("://");
        sf.append(request.getServerName());
        sf.append(":");
        sf.append(request.getServerPort());
        sf.append(request.getContextPath());
        sf.append("/BROKER-REGISTER?pageId=").append(pageId);
        System.out.println("path[" + sf.toString() + "]");
    %>
            initBroker("<%=sf.toString()%>");

            formSearch();
                      
        }        
        -->
</script>

<body onload="initPage()">
    <div class="data_form" >
        <div class="head_data_form">
        </div>

        <div class="show_form">

            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                <tr>
                    <td><strong>Driver</strong></td>
                </tr>
                <tr>
                    <td align="center">
                        <form action="/" id="actionForm" name="actionForm" >
                            <div id="panel" style="visibility: visible"></div>

                            <fieldset class="fieldsetForm"><legend><strong id="fieldSetLabel" >Driver Search</strong></legend>
                                <jsp:include page="sys_msg.jsp" />



                                <div id="formSearch" style="visibility: visible; position: absolute; ">
                                    <table width="100%" border="0" align="center">
                                        <tr>
                                            <td valign="top" class="wLabel"><label>Date</label></td>
                                            <td>
                                                <work:calendar id="fromTime" label="From Time"/>
                                                <work:calendar id="toTime" label="To Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/>
                                            </td>

                                        </tr>
                                        <tr>
                                            <td valign="top" class="wLabel">Customer<label>To Date</label></td>
                                            <td>
                                                <work:text id="customerName" label="Customer"/>
                                                <work:button id="toTime" label="Select" onclick="showCustomerPanel()"/>
                                                <work:field-hidden id="customerId" name="customerId"/>
                                            </td>
                                            <td id="div_fromTime_3" width="40%"><div id="div_fromTime_msg"></div></td>
                                        </tr>                        

                                        <tr>
                                            <td align="center" colspan="2">
                                                <work:button id="bSearch" label="Search" onclick="search(0)"/>&nbsp;
                                                <work:button id="bAdd" label="Add New" onclick="setInsert()"/>&nbsp;                                                
                                            </td>
                                        </tr>
                                    </table>
                                    <br>
                                    <div class="divTableData">
                                        <table id="tableData" width="100%" border="0" align="center" >
                                            <thead id="tableDataHeader">
                                            </thead>
                                            <tbody id="tableDataBody" style="overflow: auto">
                                            </tbody>
                                            <tfoot id="tableDataFooter"></tfoot>
                                        </table>
                                    </div>
                                </div>
                                <div id="div_customer_panel" style="position: absolute; visibility: hidden; border-color: #FFFFCC; background-color: #FFFFCC">
                                    <form id="custForm" name="custForm" action="#">
                                        <table>
                                            <tr>
                                                <td>
                                                    <input type="text" id="customerName" name="customerName" tooltipText="Use Customer Name search"/>
                                                    <input type="button" id="subCustomer" name="subCustomer" value="Find" onclick="findCustomer(0)"/>
                                                    <input type="button" id="closeCustomer" name="closeCustomer" value="Close" onclick="closeCustomerPanel()"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table id="tablecustomer" width="100%" border="1" style="border: thick; border-color:#999; overflow: auto">
                                                        <tbody id="tablecustomerBody"/>
                                                    </table>
                                                </td>
                                            </tr>        
                                        </table>     
                                    </form>     
                                </div>

                                <div class="bottom_data_form">
                                </div>

                                </div>
                                </body>

